package ttsolver.enums;

public enum OptStat {
	MIPOPTIMAL (1400),
	LPOPTIMAL (1401),
	OPTIMALINFEAS (1402),
	UNOPTIMIZED (1403),
	ERROR (1404),
	FEASIBLE (1405),
	INFEASIBLE (1406),
	NOINTEGER (1407),
	NOFEASIBLE (1408),
	UNBOUNDED (1409),
	UNKNOWN (1499);
	
	private int id;

	private OptStat(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}
	
	public static OptStat valueOf(int id) {
		for (OptStat stat : OptStat.values())
			if ( stat.getId() == id )
				return stat;
		return null;
	}
	
	public static OptStat parse(String name) {
		for (OptStat stat : OptStat.values())
			if ( stat.name().equalsIgnoreCase(name) )
				return stat;
		return null;
	}
}
